import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MessageService } from '../../core/service';
import { LayoutRourteStatus } from 'src/app/model/status';
import { StorageService } from 'src/app/core/sotrage/storage.service';

@Component({
  selector: 'app-menu',
  templateUrl: './menu.component.html',
  styleUrls: ['./menu.component.scss']
})
export class MenuComponent implements OnInit {

  url: string;

  @Input()
  isCollapsed: boolean;


  @Output()
  menuEvent: EventEmitter<string> = new EventEmitter<string>();

  constructor(
    private storageService: StorageService,
    private msg: MessageService
  ) { }
  private user: any
  private cfindex: number = 0;
  ngOnInit() {
    this.user = this.storageService.get('wenyao-web-fallet-user-info');

    this.msg.getMessage().subscribe((e: LayoutRourteStatus) => {
      if (e.url) {
        this.url = e.url;
      }
      if (e['text'] == 'length') {
        console.log(e)
        this.cfindex = e['data']['index'];
      }

    });
  }
  public change(e) {

  }
}
